function  ortho_overlay_act( S )
                
global OSLDIR;

%set(gcf,'Color','k');

[ mni_res ] = get_nii_spatial_res( S.fname );
mni_res=mni_res(1);
ind = osl_mnicoords2ind(S.mnicoord, mni_res);
ind=ind+1;
map=ra(S.fname);
bgmap=ra([OSLDIR '/std_masks/MNI152_T1_' num2str(mni_res) 'mm_brain']);
map=mean(map,4); 
x1=squash(abs(map),abs(map));
try
    low=percentile((x1),S.percrange(1));
    high=percentile((x1),S.percrange(2));
catch
    low=min(x1);
    high=max(x1);
end;

if(low==high)
    low=min(x1);
    high=max(x1);
end;

% plot colorbar
snugplot(1,5,5);
make_colorbar([low high],'red2yellow');
freezeColors; % needed as colormaps are a property of the whole figure;

snugplot(1,5,1);
deact_cmapname='cool';
make_colorbar([-low -high],deact_cmapname);
freezeColors; % needed as colormaps are a property of the whole figure;

% plot ortho views
snugplot(1,5,2,0.05);
overlay_act(flipud(squeeze(map(ind(1),:,:))'), flipud(squeeze(bgmap(ind(1),:,:))'),'red2yellow',0,[low high],[3000 8000],deact_cmapname,[low high]);
title([S.title],'fontsize',14);
snugplot(1,5,3,0.05);
overlay_act(flipud(squeeze(map(:,ind(2),:))'), flipud(squeeze(bgmap(:,ind(2),:))'),'red2yellow',0,[low high],[3000 8000],deact_cmapname,[low high]);
snugplot(1,5,4,0.05);
overlay_act(flipud(squeeze(map(:,:,ind(3)))'), flipud(squeeze(bgmap(:,:,ind(3)))'),'red2yellow',0,[low high],[3000 8000],deact_cmapname,[low high]);
    
end

